package com.web.customers;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.domain.Customer;
import com.service.CustomerService;
import com.util.AuthenticateHttpServlet;

@WebServlet("/Customer/EditForm")
public class CustomerEditFormController extends AuthenticateHttpServlet {
 /**
	 * 
	 */
	private static final long serialVersionUID = -5091789489370823517L;

protected void post(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{
	 	 
	 String customer_id = req.getParameter("CUSTOMER_ID");
	 CustomerService model = new CustomerService();
	 Customer customer = model.findSingleCustomer(customer_id);
	 req.setAttribute("customer", customer);
	 req.getRequestDispatcher("/WEB-INF/jsp/CustomerUpdate.jsp").forward(req, resp);
	 
 }
}
